<?php
//echo $this->dojo();
// $table = new Task_Model_DbTable_Task();
$table =  $this->table;
$form = $this->form;
$row = $table->search(Zend_Controller_Front::getInstance()->getRequest()->getUserParams())->current();

?>
<h1>View <?= $this->table->getNiceName() ?>: <?= Bushido_Db_Table::getDisplayValue($row) ?></h1>



<div id="recordViewTabset" class="yui-navset">
	<ul class="yui-nav">
		<li class="selected"><a href="#viewEditRecord"><em>View / Edit</em></a></li>
	</ul>
	<div id="viewEditRecord" class="yui-content">
		<?php 
		$pkField = current($table->info(Bushido_Db_Table_Abstract::PRIMARY));
		echo $form;
		?>
	</div>
</div>
<script type="text/javascript">
	(
		function()
		{
			var recordTabView = new YAHOO.widget.TabView('recordViewTabset');
			
			
			YAHOO.plugin.Dispatcher.delegate
			(
				new YAHOO.widget.Tab
				(
					{
						label: 'History',
						dataSrc: '<?= Zend_Controller_Front::getInstance()->getBaseUrl() ?>/<?= Zend_Controller_Front::getInstance()->getRequest()->getModuleName() ?>/<?= Zend_Controller_Front::getInstance()->getRequest()->getControllerName() ?>/audit/useLayout/false/table_name/<?= $table->getName() ?>/pk/<?= urlencode($row->getPKString()) ?>'
					}
				),
				recordTabView);

			//recordTabView.render();
		}
	)();

</script>
